package cn.yuanqiao.archive.collection.appManager.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 资料树对象
 *
 * @ProjectName: ruoyi-modules-system
 * @Package: cn.yuanqiao.archive.appManager.domain
 * @ClassName: YqDataTree
 * @Author: lenovo
 * @Description: hbWang
 * @Date: 2023/7/28 11:33
 * @Version: 1.0
 */

public class YqDataTree extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_YQ_DATA_TREE";

    private String tableName;

    public YqDataTree() {
        String tenantCode = SecurityUtils.getTenantCode();
        if (StringUtils.isEmpty(tenantCode)) {
            throw new ServiceException("TenantCode is null");
        } else {
            this.tableName = tenantCode.toUpperCase() + BIGTABLENAME;
        }
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }

    /**
     * 资料树id
     */
    private String ID;

    /**
     * 类别名称
     */
    @Excel(name = "类别名称")
    private String dataName;

    /**
     * 类别代码
     */
    @Excel(name = "类别代码")
    private String dataCode;

    /**
     * 顺序
     */
    @Excel(name = "顺序")
    private String orderNum;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remarks;

    public String getID() {
        return ID;
    }

    public void setID(String ID) {
        this.ID = ID;
    }

    public String getDataName() {
        return dataName;
    }

    public void setDataName(String dataName) {
        this.dataName = dataName;
    }

    public String getDataCode() {
        return dataCode;
    }

    public void setDataCode(String dataCode) {
        this.dataCode = dataCode;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("ID", ID)
                .append("dataName", dataName)
                .append("dataCode", dataCode)
                .append("orderNum", orderNum)
                .append("remarks", remarks)
                .toString();
    }
}
